#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include "setting.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class QSystemTrayIcon;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QSystemTrayIcon *pSysTrayIcon = nullptr;
    int second = -1;
    QMenu *pMenu;
    Setting *pSetting = nullptr;
    void heartBeatCheck();
    QSettings settings;

protected:
    void showWindow();
    void showSetting();
    void showMenu();
    void OnExit();
    void closeEvent(QCloseEvent *event);

private slots:
    void changLabel();
    void activeTray(QSystemTrayIcon::ActivationReason reason);
};
#endif // MAINWINDOW_H
